<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="utf-8">
    <title>MySQL数据库详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="./layui/css/layui.css" th:href="@{/layui/css/layui.css}" media="all">
    <link rel="stylesheet" href="./style/admin.css" th:href="@{/style/admin.css}" media="all">
    <link rel="stylesheet" href="./style/myself.css" th:href="@{/style/myself.css}" media="all">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="./js/html5.min.js" th:src="@{/js/html5.min.js}"></script>
    <script src="./js/respond.min.js" th:src="@{/js/respond.min.js}"></script>
    <![endif]-->
    <script type="text/javascript" charset="utf-8" th:inline="javascript">
        var ctxPath = /*[[@{/}]]*/'';
        var tokenValue = /*[[${_csrf.token}]]*/'';
        // 数据库详情的主键ID
        var id = [[${monitorDbVo.id}]];
        var authority = [[${#authorization.expression('hasAuthority("超级管理员")')}]];
    </script>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class="layui-this">会话管理</li>
                <li>概要</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-card">
                        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                            <form class="layui-form-item" onsubmit="return false;">
                                <div class="layui-inline">
                                    <label class="layui-form-label">用户</label>
                                    <div class="layui-input-block">
                                        <input autocomplete="off" class="layui-input" name="user" placeholder="请输入"
                                               type="text">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">主机</label>
                                    <div class="layui-input-block">
                                        <input autocomplete="off" class="layui-input" name="host" placeholder="请输入"
                                               type="text">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">数据库</label>
                                    <div class="layui-input-block">
                                        <input autocomplete="off" class="layui-input" name="db" placeholder="请输入"
                                               type="text">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">命令</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="command" placeholder="请输入" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">状态</label>
                                    <div class="layui-input-block">
                                        <input autocomplete="off" class="layui-input" name="state" placeholder="请输入"
                                               type="text">
                                    </div>
                                </div>
                                <div class="layui-inline" style="width: 85%">
                                    <label class="layui-form-label">命令文本</label>
                                    <div class="layui-input-block">
                                        <input autocomplete="off" class="layui-input" name="info"
                                               placeholder="请输入" type="text">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <button class="layui-btn layuiadmin-btn-useradmin" lay-submit
                                            lay-filter="list-table-search">
                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                    </button>
                                    <button class="layui-btn" id="reset" lay-filter="list-table-reset" lay-submit
                                            type="reset">
                                        清空
                                    </button>
                                </div>
                            </form>
                        </div>
                        <div class="layui-card-body">
                            <table id="list-table" lay-filter="list-table"></table>
                            <script type="text/html" id="imgTpl">
                                <img style="display: inline-block; width: 50%; height: 100%;" src={{ d.avatar }}>
                            </script>
                            <script type="text/html" id="list-table-toolbar">
                                <div class="layui-btn-group">
                                    <button class="layui-btn layui-btn-sm layuiadmin-btn-useradmin"
                                            lay-event="batchRefresh">
                                        <i class="layui-icon layui-icon-refresh"></i>刷新
                                    </button>
                                    <button class="layui-btn layui-btn-sm layui-btn-danger"
                                            sec:authorize="hasAuthority('超级管理员')"
                                            lay-event="batchdel">
                                        <i class="layui-icon layui-icon-delete"></i>结束
                                    </button>
                                </div>
                            </script>
                            <script type="text/html" id="list-table-toolbar-detail">
                                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"
                                   sec:authorize="hasAuthority('超级管理员')">
                                    <i class="layui-icon layui-icon-delete"></i>结束</a>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <form action="javascript:;" class="layui-form layui-form-pane" id="layuiadmin-form-useradmin">
                        <div class="layui-form-item">
                            <label class="layui-form-label">数据库ID</label>
                            <div class="layui-input-block">
                                <input type="text" name="id" disabled class="layui-input" th:value="${monitorDbVo.id}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">连接名</label>
                            <div class="layui-input-block">
                                <input type="text" name="connName" disabled class="layui-input"
                                       th:value="${monitorDbVo.connName}">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">URL</label>
                            <div class="layui-input-block">
                                <textarea th:text="${monitorDbVo.url}" name="url" class="layui-textarea" disabled>
                                </textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">用户名</label>
                            <div class="layui-input-block">
                                <input type="text" name="username" disabled class="layui-input"
                                       th:value="${monitorDbVo.username}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">类型</label>
                            <div class="layui-input-block">
                                <input type="text" name="dbType" disabled class="layui-input"
                                       th:value="${monitorDbVo.dbType}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">驱动类</label>
                            <div class="layui-input-block">
                                <input type="text" name="driverClass" disabled class="layui-input"
                                       th:value="${monitorDbVo.driverClass}">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">描述</label>
                            <div class="layui-input-block">
                                <textarea th:text="${monitorDbVo.dbDesc}" disabled name="dbDesc"
                                          class="layui-textarea"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">状态</label>
                            <div class="layui-input-block">
                                <input type="text" name="isOnline" disabled class="layui-input"
                                       th:if="${monitorDbVo.isOnline=='0'}" value="异常">
                                <input type="text" name="isOnline" disabled class="layui-input"
                                       th:if="${monitorDbVo.isOnline=='1'}" value="正常">
                                <input type="text" name="isOnline" disabled class="layui-input"
                                       th:if="${monitorDbVo.isOnline=='' || monitorDbVo.isOnline==null}" value="未知">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">新增时间</label>
                            <div class="layui-input-block">
                                <input type="text" name="insertTime" disabled class="layui-input"
                                       th:value="${#dates.format(monitorDbVo.insertTime,'yyyy/MM/dd HH:mm:ss')}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">更新时间</label>
                            <div class="layui-input-block">
                                <input type="text" name="updateTime" disabled class="layui-input"
                                       th:value="${#dates.format(monitorDbVo.updateTime,'yyyy/MM/dd HH:mm:ss')}">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="./js/common.js" th:src="@{/js/common.js}" charset="utf-8"></script>
<script src="./layui/layui.js" th:src="@{/layui/layui.js}"></script>
<script charset="utf-8" th:inline="javascript">
    var extend = {
        index: 'lib/index'//主入口模块
    };
    var use = ['index', 'element', 'form'];
    if ([[${monitorDbVo.dbType}]].toLowerCase() === 'mysql') {
        extend.dbSession4mysql = 'db/dbSession4mysql';
        use.push('dbSession4mysql');
    }
    layui.config({
        base: ctxPath //静态资源所在路径
    }).extend(extend).use(use);
</script>
</body>
</html>